package com.hyt.it.ogt.kq.service.bm.feign.kw;

import com.hyt.common.apiInfor.ApiResponse;
import com.hyt.core.exception.RemoteRequestException;
import com.hyt.it.ogt.kq.service.bm.feign.kw.model.ArrageStudent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 
 * feign客户端熔断器
 *
 */
@Component
@Slf4j
public class KwClientHystrix implements KwClient {


	@Override
	public ApiResponse queryPage(String projectId) throws Exception {
		log.error("#分页查询考试数据失败，进入熔断");
		throw new Exception("分页查询考试数据失败");
	}

	@Override
	public ApiResponse queryGrade(String projectId, String subjectId, String candidateId){
		log.error("#分页查询科目成绩失败，进入熔断");
		throw new RemoteRequestException(31111402, "分页查询科目成绩失败");
	}

	@Override
	public ApiResponse statExam(String projectId) throws Exception {
		log.error("#统计项目数据失败，进入熔断");
		throw new Exception("统计项目数据失败");
	}


	@Override
	public Object getExamInfo(String examId) throws Exception {
		log.error("#分页查询科目成绩失败，进入熔断");
		throw new Exception("分页查询科目成绩失败");
	}

	@Override
	public ApiResponse arrageStudent(@RequestBody ArrageStudent arrageStudent) throws Exception {
		log.error("#编排考生失败，进入熔断");
		throw new Exception("编排考生失败");
	}

	@Override
	public ApiResponse countFinishCandidateNumber(String beginTime, String endTime,
										   String officeId) throws Exception {
		log.error("#统计完成考试失败，进入熔断");
		throw new Exception("统计完成考试失败，进入熔断");
	}

	@Override
	public ApiResponse findCandidateFinishExamCount(String beginTime, String endTime,
												  String officeId, String state) throws Exception {
		log.error("#统计完成考试人数失败，进入熔断");
		throw new Exception("统计完成考试人数失败，进入熔断");
	}
}
